Passed
Push — master ( fd5993...4f9324 )
by Vinicius
03:57 queued 01:54
created

router.js ➔ ???   A

Complexity

Conditions 1
Paths 2

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 1
Metric Value
cc 1
nc 2
nop 2
dl 0
loc 10
ccs 5
cts 5
cp 1
crap 1
rs 9.9
c 2
b 0
f 1

1 Function

Rating   Name   Duplication   Size   Complexity  
A router.js ➔ ... ➔ ??? 0 8 3
1
/**
2
 * @method setup
3
 * @param  {Function}   setTitle    setTitle callback
4
 * @param  {Object}     options     { router: RouterInstance }
0 ignored issues
show
Documentation introduced by
The parameter options does not exist. Did you maybe forget to remove this comment?
Loading history...
5
 * @return {void}
6
 */
7 2
const setup = (setTitle, { router }) => {
8 1
  router.afterEach((to, from) => {
0 ignored issues
show
Unused Code introduced by
The parameter from is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
9 2
    const { meta } = to
10
11
    // if has meta and title
12 4
    if (meta && meta.title) {
13 1
      setTitle(meta.title)
14
    }
15
  })
16
}
17
18
export { setup }
19